import { zhCn } from 'element-plus/es/locale'
import { createI18n } from 'vue-i18n'
import en from '/@ts/language/lib/en';
import zh from '/@ts/language/lib/zh';
import { language } from './index.d';
import { getLocalStorage } from '../hooks/storage';
export const messages = [
  {
   name: '简体中文',
   value: 'zh'
  },
  {
    name: 'English',
    value: 'en'
   },
]
const getLanguage = () => {
 let key = getLocalStorage(language)
 return key || 'zh'
}
export const i18n = createI18n({
  locale: getLanguage(),
  allowComposition: true, // you need to specify that!
  messages:  {
    zh,en
  }
})
